﻿using System;
using System.Collections.Generic;

namespace ASP.NetAjaxApplication.Models
{
    public  class LineItemRepository :IRepository<LineItemModel>
    {
        private IEnumerable<LineItemModel> _listLineItems;
        public void Update(IEnumerable<LineItemModel> data)
        {
            _listLineItems = data;
        }

        #region Implementation of IRepository<LineItemModel>

        public IEnumerable<LineItemModel> GetAll()
        {
            if (_listLineItems==null)
            {
                _listLineItems = DummyData.CreateListLineItems();
            }
            return _listLineItems;
        }

        public LineItemModel Insert(LineItemModel value)
        {
            throw new NotImplementedException();
        }

        public bool Update(LineItemModel value)
        {
            throw new NotImplementedException();
        }

        public bool Delete(LineItemModel value)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}